//----导出组件
import type { App } from "vue";
export type { DictEntryModel } from "@/api/dict/os-dict-entry/types";
export type { DictLayEntryModel } from "@/api/dict/os-dict-lay-entry/types";

//添加组件.
import { addViteMenus, i18n } from "jmash-core";
// 本地语言包
import { loadLang } from "./lang";

const modules = import.meta.glob("./views/**/**.vue");

//组件
import JmashDictSelect from "./components/JmashDictSelect/index.vue";
import JmashSelect from "./components/JmashSelect/index.vue";
import JmashDictRadio from "./components/JmashDictRadio/index.vue";
import JmashDictCheckbox from "./components/JmashDictCheckbox/index.vue";

export { dictMapCache } from "./api/dict/index";
export { dictTypeApi } from "./api/dict/os-dict-type/index";
export type { DictTypeReq, DictTypeModel } from "./api/dict/os-dict-type/types";

//数据字典实体
export {
  EntryDict,
  EntryBizLayDict,
  EntryIdBizLayDict,
} from "./api/dict/index";

// 全局注册Jmash-dict插件.
const dict = {
  install(app: App) {
    addViteMenus(modules, 7);
    loadLang(i18n);
    app.component("jmash-dict-select", JmashDictSelect);
    app.component("jmash-select", JmashSelect);
    app.component("jmash-dict-radio", JmashDictRadio);
    app.component("jmash-dict-checkbox", JmashDictCheckbox);
  },
};
export default dict;
